package com.chookss.view;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager;

import com.chookss.R;


/**
 * 加载……
 * <p>
 * 使用方法：
 * <p>
 * LoadingDialog dialog = new LoadingDialog(OcrActivity.this);
 * dialog.setCanceledOnTouchOutside(false); //显示
 * dialog.show();
 * <p>
 * dialog.dismiss();//取消
 */
public class LoadingDialog2 extends Dialog {



    public LoadingDialog2(Context context) {
        super(context, R.style.LightProgressDialog);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.loading_dialog2);
        WindowManager.LayoutParams lp = getWindow().getAttributes();
        Window wm = getWindow();
        lp.width = lp.WRAP_CONTENT;
        lp.height = lp.WRAP_CONTENT;
        lp.dimAmount = 0.2f;
        wm.setGravity(Gravity.CENTER);
        wm.setWindowAnimations(R.style.LightProgressDialog);
        getWindow().setAttributes(lp);

    }

}
